<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" name="viewport" id="viewport" />
<title>获取您的UDID</title>
<body>
<div id="content">


<span id="udid">{$udid}</span>
<button class="btn">Copy</button>
</div>
<script src="__JS__/jquery.js"></script>

<script  src="__JS__/clipboard/dist/clipboard.min.js"></script>
<script>
    /*var clipboard = new ClipboardJS('.btn', {
        text: function() {
            var val = $("#udid").text();
            return val;
        }
    });

    clipboard.on('success', function(e) {
        console.log(e);
    });

    clipboard.on('error', function(e) {
        console.log(e);
    });*/
    
    navigator.clipboard.writeText('Linr Text to be copied')
      .then(() => {
        console.log('Text copied to clipboard');
      })
      .catch(err => {
        // This can happen if the user denies clipboard permissions:
        console.error('Could not copy text: ', err);
    });
</script>
</body>
</html>